//
// Created by work on 24-6-6.
//

#ifndef IOT_PLAT_CRTMODELYCINFO_H
#define IOT_PLAT_CRTMODELYCINFO_H

#include <iot_model_device/CRtModelSigBase.h>
#include <os/miscellany/CConfigs.h>

namespace iotplat {

    class CRtModelYcInfo : public CRtModelSigBase{
    public:

        float base;
        float coef;
        bool en_alarm;
        float alarm_up_limit;
        float alarm_down_limit;
        std::string alarm_up_limit_desc;
        std::string alarm_down_limit_desc;
        int alarm_time_count;

        enum EModelYcCol {
            EBase = 7,
            ECoef,
            EEn_alarm,
            EAlarm_up_limit,
            EAlarm_down_limit,
            EAlarm_up_limit_desc,
            EAlarm_down_limit_desc,
            EAlarm_time_count
        };

        static std::map<CRtModelYcInfo::EModelYcCol, std::string> rtModelYcColToStringMap;
        static std::map<CRtModelYcInfo::EModelYcCol, CValue::EValueType> rtYcDataTypeByField;

    public:

        explicit CRtModelYcInfo();
        void fromJson(Json::Value json);
        Json::Value toJson();

    };
    static const char* t_yc_name = "t_model_yc";

#define YC_ENUM                     CRtModelYcInfo::EModelYcCol
#define ycFieldName(type)           CRtModelYcInfo::rtModelYcColToStringMap.find(type)->second
#define ycDataTypeByField(type)     CRtModelYcInfo::rtYcDataTypeByField.find(type)->second

} // iotplat

#endif //IOT_PLAT_CRTMODELYCINFO_H
